package com.carpedil.log;

import org.aspectj.lang.ProceedingJoinPoint;

/** @author Administrator */
public class LogEnhancer {
  public void logBefore() {
    System.out.println("前置通知......");
  }

  public void logAfterReturning() {
    System.out.println("后置通知......");
  }

  public void logAfter() {
    System.out.println("最后通知......");
  }

  public void aroundLog(ProceedingJoinPoint joinPoint) {
    System.out.println("环绕通知开始----");
    try {
      joinPoint.proceed();
    } catch (Throwable throwable) {
      System.out.println("有异常");
    }
    System.out.println("环绕通知结束----");
  }

  public void logException(Throwable e) {
    System.out.println("异常通知: " + e.getMessage());
  }
}
